package com.sfdk.graphics.engine.data
{
import com.sfdk.graphics.engine.api.ITileset;

public class TileInfo
	{
		private var _tileset : ITileset;
		private var _tileX : int;
		private var _tileY : int;
		
		public function TileInfo(tileset : ITileset , tileX : int, tileY : int)
		{
			_tileset = tileset;
			_tileX = tileX;
			_tileY = tileY;
		}
		
		public function setData(tileset : ITileset , tileX : int, tileY : int) : void
		{
			_tileset = tileset;
			_tileX = tileX;
			_tileY = tileY;
		}
		
		public function get tileset() : ITileset
		{
			return _tileset;
		}
		
		public function get tileX() : int
		{
			return _tileX;
		}
		
		public function get tileY() : int
		{
			return _tileY;
		}
		
		public function equals(tileInfo : TileInfo) : Boolean
		{
			if(_tileset == null && tileInfo.tileset == null)
				return true;
			else if(_tileset == null || tileInfo == null || tileInfo.tileset == null)
				return false;
			if(_tileset.id != tileInfo.tileset.id)
				return false;
			if(_tileX != tileInfo.tileX)
				return false;
			return _tileY == tileInfo.tileY;
			

		}
	}
}